This XCMD (un)locks the "control key". The control key is only found on newer Mac keyboards, but this XMCD does not require there to be a real one so it works fine on Mac Pluses! When locked any keystroke with the command key UP will cause a "controlKey num" message, command keystokes are NOT affected.
-- part contents for background part 2
----- text -----
ControlLock "on" -- lock the control key (if unlocked)
ControlLock "off" -- unlock the control key (if locked)
on controlKey num
-- your script, num is the Mac character set value for the key